﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms.Design;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;


[ToolStripItemDesignerAvailability(ToolStripItemDesignerAvailability.All)]
public class SuggestComboboxToolstripMenu : ToolStripControlHost
{

    //public SuggestComboboxToolstripMenu(Control c)
    //    : base(c)
    //{
    //}

    [RefreshProperties(RefreshProperties.All), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
    public SuggestComboBox SuggestComboBoxControl
    {
        get
        {
            return Control as SuggestComboBox;
        }
    }

    public event PageIndex_ChangedEventHandler PageIndex_Changed;
    public delegate void PageIndex_ChangedEventHandler(object sender, EventArgs e);
    //
    private void _PageChanged(object sender, EventArgs e)
    {
        if (PageIndex_Changed != null)
        {
            PageIndex_Changed(sender,e);
        }
    }
    //


    [RefreshProperties(RefreshProperties.All)]
    public SuggestComboboxToolstripMenu()
        : base(new SuggestComboBox())
    {
        (Control as SuggestComboBox).SelectedIndexChanged += _PageChanged;
    }


    
    protected override void OnSubscribeControlEvents(Control c)
    {
        base.OnSubscribeControlEvents(c);
        //SuggestComboBox combobox = (SuggestComboBox)c;
    }

    protected override void OnUnsubscribeControlEvents(Control c)
    {
        base.OnUnsubscribeControlEvents(c);
        //SuggestComboBox checkBox = (SuggestComboBox)c;
    }

}

